<%-- 
    Document   : Login
    Created on : Sep 2, 2011, 1:25:00 AM
    Author     : James
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@page import="java.util.ArrayList, BusinessLogic.Constants, EntityState.CustomerState" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%
    ArrayList data = (ArrayList) request.getAttribute("data");
    int result = ((Integer) data.get(0)).intValue();
    if (result == Constants.STATUS_NEW_SESSION) {
%>
<form action="https://localhost:8181/portal/public/LoginStatus" id="main_login_form" name="login_form" method="POST">
    <input type="hidden" id="currentURL" name="currentURL" />
    <table width="260">
        <tr>
            <td width="75" align="right"><span style="font-size:15px">Username:</span></td>
            <td><input type="text" id="username" name="username" size="20" value=""/></td>
        </tr>
        <tr>
            <td></td>
            <td><span style='font-size:10px;color:#FFFFFF;'><a href="./Forgot?target=username">(Forgot your Username?)</a></span></td>
        </tr>
        <tr>
            <td align="right"><span style="font-size:15px">Password:</span></td>
            <td><input type="password" id="password" name="password" size="20" value=""/></td>
        </tr>
        <tr>
            <td></td>
            <td><span style='font-size:10px;color:#FFFFFF;'><a href="./Forgot?target=password">(Forgot your Password?)</a></span></td>
        </tr>
    </table>
    <p align="middle"><input type="submit" value="Sign in" /></p>
</form>
<hr>
<p class="white" align="middle">Don't have a Lingua123 ID?<br/><br/>
    <input type="button" align="middle" value="Create New Account" onclick="window.open('./AccountRegistration');" /> 
</p>
<%
    } else {
        CustomerState us = (CustomerState) session.getAttribute("user");
%>
<p style="font-family:'Palatino Linotype', 'Book Antiqua', Palatino, serif;font-size:21px">Welcome! <%= us.getUsername() %>,</p>
<p><a class='white' href='./TransactionHistory' target="_new" >Transaction history</a></p>
<p><a class='white' href='./Profile' >Your profile</a></p>
<p><a class='white' href='./ChangePassword' >Change your password</a></p>
<p><a class='white' href='./SignOut' onclick="signOut();" >Sign out</a></p>
<%
    }
%>

